package control;

import javax.microedition.lcdui.Graphics;

public class TabControl extends GroupControl {
	private int tabIndex;

	public TabControl(int numControl) {
		super(numControl);
		setTabIndex(0);
	}
	public void setTab(int tab)
	{
		setTabIndex(tab);
	}
	public boolean pointerPressed(int x, int y) {

		Control ctr = controls[getTabIndex()];
		ctr.pointerPressed(x, y);

		return false;
	}

	public boolean pointerReleased(int x, int y) {

		Control ctr = controls[getTabIndex()];
		ctr.pointerReleased(x, y);

		return false;
	}

	protected void controlPaint(Graphics g) {
		Control ctr = controls[getTabIndex()];
		ctr.paint(g);
	}
	public int getTabIndex() {
		return tabIndex;
	}
	public void setTabIndex(int tabIndex) {
		this.tabIndex = tabIndex;
	}
}
